<style lang="less">
</style>
<template>
    <div class="search">
        <Row>
            <Col>
                <Card>
                    <Form ref="archivesLogForm" :model="archivesLogForm" inline :label-width="50" class="search-form">
                        <Row>
                            <Table :loading="loading" border :columns="columns" :data="data" sortable="custom"
                                   @on-sort-change="changeSort" @on-selection-change="showSelect" ref="table">
                                <template slot-scope="{row, index }" slot="action">
                                    <Button type="error" size="small" @click="remove(row)">删除</Button>
                                    <Button style="margin-right:5px" type="primary" size="small" @click="edit(row)">修改</Button>
                                </template>
                            </Table>
                        </Row>
                        <Row type="flex" justify="end" class="page">
                            <Page
                                :current="archivesLogForm.pageNumber"
                                :total="total"
                                :page-size="archivesLogForm.pageSize"
                                @on-change="changePage"
                                @on-page-size-change="changePageSize"
                                :page-size-opts="[10,20,50]"
                                size="small"
                                show-total
                                show-elevator
                                show-sizer
                            ></Page>
                        </Row>
                    </Form>
                </Card>
            </Col>
        </Row>
    </div>
</template>
<script>
    import {
        //获取档案日志信息
        getArchivesLogInfoById,
    } from  "@/projects/afs-channel/api/dealer/dealer";
    export default {
        name: "archivesLog",
        components:{

        },
        data() {
            return {
                loading: false,
                operationLoading: false,
                importLoading: false,
                loadingExport: true,
                selectCount: 0,
                selectList: [],
                accountForm: {
                    pageNumber: 1,
                    pageSize: 10,
                },
                channelId:"",
                selectDate: null,
                modalType: 0,
                channelModalVisible: false,
                modalTitle: "",
                receivingName:"",
                archivesLogForm: {
                    pageNumber: 1,
                    pageSize: 10,
                },

                columns: [

                    {
                        title: "操作类型",
                        key: "eventName",
                        minWidth: 150
                    },
                    {
                        title: "修改",
                        key: "description",
                        minWidth: 155
                    },
                    {
                        title: "操作人",
                        key: "createBy",
                        minWidth: 150
                    },
                    {
                        title: "操作时间",
                        key: "createTime",
                        minWidth: 150
                    },
                    {
                        title: "状态显示",
                        key: "electronicBankNo",
                        minWidth: 150
                    },
                ],
                data: [],
                total: 0
            };
        },
        methods: {
            init() {

            },
            changePage(v) {
                this.archivesLogForm.pageNumber = v;
                this.getArchivesLogInfo(this.channelId);
                this.clearSelectAll();
            },
            changePageSize(v) {
                this.archivesLogForm.pageSize = v;
                this.getArchivesLogInfo(this.channelId);
            },

            changeSort(e) {
                this.archivesLogForm.sort = e.key;
                this.archivesLogForm.order = e.order;
                if (e.order === "normal") {
                    this.archivesLogForm.order = "";
                }
                this.getArchivesLogInfo();
            },
            showSelect(){

            },
            getArchivesLogInfo(v) {
                //根据渠道id查询档案日志信息
                this.loading = true;
                this.channelId=v;
                this.archivesLogForm.channelId=v;
                getArchivesLogInfoById(this.archivesLogForm).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                        this.data = res.data.records;
                        this.total = res.data.total;
                    }
                })
            },
            clearSelectAll() {
            },
        },
        mounted() {

        }
    };
</script>
